#!/usr/bin/env python
PACKAGE = "ipa_building_navigation"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

# TSP solver
tsp_enum = gen.enum([ gen.const("NearestNeighbor", int_t, 1, "Use the nearest neighbor TSP algorithm."),
                       gen.const("GeneticSolver", int_t, 2, "Use the genetic TSP algorithm."),
                       gen.const("ConcordeSolver", int_t, 3, "Use the Concorde TSP algorithm.")],
                     "TSP solver")
gen.add("tsp_solver", int_t, 0, "TSP solver", 3, 1, 3, edit_method=tsp_enum)

# problem setting
problem_setting_enum = gen.enum([	gen.const("SimpleOrderPlanning", int_t, 1, "Plan the optimal order of a simple set of locations."),
									gen.const("CheckpointBasedPlanning", int_t, 2, "Two-stage planning that creates local cliques of locations (= checkpoints) and determines the optimal order through the members of each clique as well as the optimal order through the cliques.")],
											"Problem setting of the sequence planning problem")
gen.add("problem_setting", int_t, 0, "Problem setting of the sequence planning problem", 2, 1, 2, edit_method=problem_setting_enum)


# checkpoint-based sequence planning specifics
trolley_placement_method_enum = gen.enum([	gen.const("DragTrolleyWhenNecessary", int_t, 1, "Drag the trolley if it is too far away from next room."),
											gen.const("PrecomputeRoomGroupsAndCorrespondingTrolleyPosition", int_t, 2, "Put rooms together in groups and calculate a corresponding trolley positions.")],
											"Trolley placement method (only applies to CheckpointBasedPlanning problem)")
gen.add("planning_method", int_t, 0, "Trolley placement method (only applies to CheckpointBasedPlanning problem)", 2, 1, 2, edit_method=trolley_placement_method_enum)

gen.add("max_clique_path_length", double_t, 0, "Max A* path length between two rooms that are assigned to the same clique, in [m] (only applies to CheckpointBasedPlanning problem)", 12.0, 0.0)

gen.add("maximum_clique_size", int_t, 0, "Maximal number of nodes belonging to one trolley clique (only applies to CheckpointBasedPlanning problem)", 9001, 0)


# general settings
gen.add("map_downsampling_factor", double_t, 0, "The map may be downsampled during computations (e.g. of A* path lengths) in order to speed up the algorithm, if set to 1 the map will have original size, if set to 0 the algorithm won't work", 0.25, 0.00001, 1.0)

gen.add("check_accessibility_of_rooms", bool_t, 0, "Tells the sequence planner if it should check the given room centers for accessibility from the starting position", True)

gen.add("return_sequence_map", bool_t, 0, "Tells the server if the map with the sequence drawn in should be returned", False)

gen.add("display_map", bool_t, 0, "Show the resulting map with paths (only if return_sequence_map=true)", False)

exit(gen.generate(PACKAGE, "room_sequence_planning_action_server", "BuildingNavigation"))
